/* 智能营养管理系统 - 自定义样式 */

/* 全局样式 */
:root {
    --primary-color: #007bff;
    --secondary-color: #6c757d;
    --success-color: #28a745;
    --info-color: #17a2b8;
    --warning-color: #ffc107;
    --danger-color: #dc3545;
    --light-color: #f8f9fa;
    --dark-color: #343a40;
    
    --border-radius: 0.375rem;
    --box-shadow: 0 0.125rem 0.25rem rgba(0, 0, 0, 0.075);
    --box-shadow-lg: 0 0.5rem 1rem rgba(0, 0, 0, 0.15);
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    line-height: 1.6;
    color: var(--dark-color);
}

/* 导航栏样式 */
.navbar-brand {
    font-weight: 600;
    font-size: 1.25rem;
}

.navbar-nav .nav-link {
    font-weight: 500;
    transition: color 0.3s ease;
}

.navbar-nav .nav-link:hover {
    color: rgba(255, 255, 255, 0.8) !important;
}

/* 卡片样式 */
.card {
    border: none;
    border-radius: var(--border-radius);
    box-shadow: var(--box-shadow);
    transition: box-shadow 0.3s ease;
}

.card:hover {
    box-shadow: var(--box-shadow-lg);
}

.card-header {
    border-bottom: 1px solid rgba(0, 0, 0, 0.125);
    font-weight: 600;
}

/* 按钮样式 */
.btn {
    border-radius: var(--border-radius);
    font-weight: 500;
    transition: all 0.3s ease;
}

.btn:hover {
    transform: translateY(-1px);
}

.btn-lg {
    padding: 0.75rem 1.5rem;
    font-size: 1.1rem;
}

/* 表单样式 */
.form-control, .form-select {
    border-radius: var(--border-radius);
    border: 1px solid #ced4da;
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
}

.form-control:focus, .form-select:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 0.2rem rgba(0, 123, 255, 0.25);
}

.form-label {
    font-weight: 500;
    margin-bottom: 0.5rem;
}

/* 营养进度条样式 */
.nutrition-progress {
    height: 1.5rem;
    border-radius: var(--border-radius);
    background-color: var(--light-color);
    overflow: hidden;
}

.nutrition-progress-bar {
    height: 100%;
    transition: width 0.6s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: 500;
    font-size: 0.875rem;
}

/* 营养卡片样式 */
.nutrition-card {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-radius: var(--border-radius);
    padding: 1.5rem;
    text-align: center;
    transition: transform 0.3s ease;
}

.nutrition-card:hover {
    transform: translateY(-5px);
}

.nutrition-card .icon {
    font-size: 2.5rem;
    margin-bottom: 1rem;
    opacity: 0.8;
}

.nutrition-card .value {
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
}

.nutrition-card .label {
    font-size: 0.875rem;
    opacity: 0.9;
}

/* 菜品卡片样式 */
.dish-card {
    border-radius: var(--border-radius);
    overflow: hidden;
    transition: all 0.3s ease;
    cursor: pointer;
}

.dish-card:hover {
    transform: translateY(-3px);
    box-shadow: var(--box-shadow-lg);
}

.dish-card .dish-image {
    height: 200px;
    background-size: cover;
    background-position: center;
    background-color: var(--light-color);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--secondary-color);
    font-size: 3rem;
}

.dish-card .dish-info {
    padding: 1rem;
}

.dish-card .dish-name {
    font-weight: 600;
    margin-bottom: 0.5rem;
    color: var(--dark-color);
}

.dish-card .dish-nutrition {
    font-size: 0.875rem;
    color: var(--secondary-color);
}

.dish-card .dish-tags {
    margin-top: 0.5rem;
}

.dish-tag {
    display: inline-block;
    padding: 0.25rem 0.5rem;
    background-color: var(--light-color);
    color: var(--secondary-color);
    border-radius: 1rem;
    font-size: 0.75rem;
    margin-right: 0.25rem;
    margin-bottom: 0.25rem;
}

/* 推荐标签样式 */
.recommended-badge {
    position: absolute;
    top: 0.5rem;
    right: 0.5rem;
    background: linear-gradient(45deg, #ff6b6b, #feca57);
    color: white;
    padding: 0.25rem 0.5rem;
    border-radius: 1rem;
    font-size: 0.75rem;
    font-weight: 600;
    z-index: 10;
}

/* 餐别标签样式 */
.meal-type-breakfast { background-color: #ffeaa7; color: #2d3436; }
.meal-type-lunch { background-color: #fab1a0; color: #2d3436; }
.meal-type-dinner { background-color: #fd79a8; color: white; }
.meal-type-snack { background-color: #a29bfe; color: white; }

/* 辣度标签样式 */
.spice-none { background-color: #ddd; color: #666; }
.spice-mild { background-color: #ffeaa7; color: #2d3436; }
.spice-medium { background-color: #fdcb6e; color: #2d3436; }
.spice-hot { background-color: #e17055; color: white; }
.spice-very-hot { background-color: #d63031; color: white; }

/* 统计图表样式 */
.chart-container {
    position: relative;
    height: 300px;
    margin: 1rem 0;
}

.chart-legend {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    margin-top: 1rem;
}

.chart-legend-item {
    display: flex;
    align-items: center;
    margin: 0.25rem 0.5rem;
    font-size: 0.875rem;
}

.chart-legend-color {
    width: 1rem;
    height: 1rem;
    border-radius: 50%;
    margin-right: 0.5rem;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .nutrition-card {
        margin-bottom: 1rem;
    }
    
    .dish-card .dish-image {
        height: 150px;
    }
    
    .chart-container {
        height: 250px;
    }
    
    .navbar-nav .nav-link {
        padding: 0.5rem 1rem;
    }
}

@media (max-width: 576px) {
    .container {
        padding-left: 1rem;
        padding-right: 1rem;
    }
    
    .card-body {
        padding: 1rem;
    }
    
    .nutrition-card {
        padding: 1rem;
    }
    
    .nutrition-card .value {
        font-size: 1.5rem;
    }
    
    .nutrition-card .icon {
        font-size: 2rem;
    }
}

/* 动画效果 */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes slideIn {
    from { transform: translateX(-100%); }
    to { transform: translateX(0); }
}

@keyframes pulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.05); }
    100% { transform: scale(1); }
}

.fade-in {
    animation: fadeIn 0.6s ease-out;
}

.slide-in {
    animation: slideIn 0.5s ease-out;
}

.pulse {
    animation: pulse 2s infinite;
}

/* 加载状态样式 */
.loading {
    display: inline-block;
    width: 1rem;
    height: 1rem;
    border: 2px solid #f3f3f3;
    border-top: 2px solid var(--primary-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* 工具提示样式 */
.tooltip-inner {
    background-color: var(--dark-color);
    color: white;
    border-radius: var(--border-radius);
    font-size: 0.875rem;
}

/* 模态框样式 */
.modal-content {
    border-radius: var(--border-radius);
    border: none;
    box-shadow: var(--box-shadow-lg);
}

.modal-header {
    border-bottom: 1px solid rgba(0, 0, 0, 0.125);
}

.modal-footer {
    border-top: 1px solid rgba(0, 0, 0, 0.125);
}

/* 面包屑导航样式 */
.breadcrumb {
    background-color: transparent;
    padding: 0;
    margin: 0;
}

.breadcrumb-item + .breadcrumb-item::before {
    content: ">";
    color: var(--secondary-color);
}

/* 自定义滚动条 */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: var(--light-color);
}

::-webkit-scrollbar-thumb {
    background: var(--secondary-color);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--dark-color);
}

/* 响应式设计 */
@media (max-width: 768px) {
    .hero-section {
        padding: 2rem 0 !important;
    }

    .hero-section .display-4 {
        font-size: 2rem;
    }

    .hero-section .lead {
        font-size: 1rem;
    }

    .feature-item {
        margin-bottom: 1rem;
    }

    .nutrition-item {
        margin-bottom: 1rem;
    }

    .meal-type-nav .btn {
        margin-bottom: 0.5rem;
    }

    .dish-card .card-body {
        padding: 0.75rem;
    }

    .dish-card .card-title {
        font-size: 0.9rem;
    }

    .nutrition-info .col-3 {
        padding: 0.25rem;
    }

    .nutrition-info .small {
        font-size: 0.7rem;
    }

    .btn-group-sm .btn {
        padding: 0.25rem 0.5rem;
        font-size: 0.75rem;
    }

    .modal-lg {
        max-width: 95%;
    }

    .pagination {
        justify-content: center;
    }

    .pagination .page-link {
        padding: 0.375rem 0.75rem;
    }

    .navbar-nav {
        text-align: center;
    }

    .navbar-nav .nav-item {
        margin: 0.25rem 0;
    }

    .table-responsive {
        font-size: 0.875rem;
    }
}

@media (max-width: 576px) {
    .container {
        padding-left: 0.75rem;
        padding-right: 0.75rem;
    }

    .card-body {
        padding: 0.75rem;
    }

    .btn-group {
        flex-direction: column;
    }

    .btn-group .btn {
        border-radius: 0.375rem !important;
        margin-bottom: 0.25rem;
    }

    .d-flex.gap-3 {
        flex-direction: column;
        gap: 0.5rem !important;
    }

    .input-group {
        width: 100% !important;
    }

    .meal-type-nav .row > div {
        margin-bottom: 0.5rem;
    }

    .nutrition-info .row {
        font-size: 0.8rem;
    }

    .step-number {
        width: 50px !important;
        height: 50px !important;
    }

    .step-number .fs-4 {
        font-size: 1.25rem !important;
    }

    .display-4 {
        font-size: 1.5rem !important;
    }

    .hero-section .feature-item {
        padding: 1rem;
    }

    .hero-section .row {
        margin: 0;
    }

    .hero-section .col-md-4 {
        padding: 0.5rem;
    }

    .modal-dialog {
        margin: 0.5rem;
    }

    .modal-header .btn-close {
        padding: 0.5rem;
    }

    .navbar-toggler {
        border: none;
        padding: 0.25rem 0.5rem;
    }

    .navbar-collapse {
        margin-top: 0.5rem;
    }
}
